﻿using System.ServiceModel;
using sscore;
using System.Data.SqlClient;

namespace DM4
{
    [ServiceContract] 
    public interface IDM4Core
    {
        [OperationContract]
        string GenerateEntityId(string code);

        SqlConnection GetDBConnection();

        ////-------------Log----------------------------
        [OperationContract]
        OperationResult WriteLog(LogType logType, string sessId = DM4Consts.SDefaultNULLId, int usrId = DM4Consts.DefaultNULLId, string message = "", MessageType messType = MessageType.Info, string modCode = "");

        [OperationContract]
        string GetSysParam(string prmName);

        [OperationContract]
        string GetModuleWorkDir(string sessionId, string ModuleCode);

        [OperationContract]
        OperationResult ExecuteDaemonCommand(string usrSessionId, string code, string command, object parameters);

        [OperationContract]
        OperationResult StartDaemon(string usrSessionId, string code = "", bool startDaemonInDebug = true);

        [OperationContract]
        OperationResult StopDaemon(string usrSessionId, string code = "");

        [OperationContract]
        OperationResult RestartDaemon(string usrSessionId, string code = "");

        [OperationContract]
        InfoClasses.DaemonStatus GetDaemonStatus(string code);

        [OperationContract]
        OperationResult GetDaemonsList(string usrSessionId);
    }
}
